package io.renren.modules.business.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.renren.common.utils.PageUtils;
import io.renren.common.utils.Query;

import io.renren.modules.business.dao.ECodeTableDao;
import io.renren.modules.business.entity.ECodeTableEntity;
import io.renren.modules.business.service.ECodeTableService;


@Service("eCodeTableService")
public class ECodeTableServiceImpl extends ServiceImpl<ECodeTableDao, ECodeTableEntity> implements ECodeTableService {

    @Autowired
    private ECodeTableDao eCodeTableDao;

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<ECodeTableEntity> page = this.page(
                new Query<ECodeTableEntity>().getPage(params),
                new QueryWrapper<ECodeTableEntity>()
        );

        return new PageUtils(page);
    }

    @Override
    public List<ECodeTableEntity> queryCode(String codeValue, Integer codeNum) {
        return eCodeTableDao.queryCode(codeValue, codeNum);
    }

}